<!--
  上传Excel文件，可拖拽
  title       ====>   标题
  multiple    ====>   是否允许多文件，默认为否

  Event
  change      ====>   文件序列发生改变

  Methods
  show        ====>   弹出操作框

-->
<template>
  <a-modal v-model:open="visible" :title="title" @ok="submit">
    <div class="base-mt20 base-mb20">
      <s-upload-drag v-model:value="files" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" :multiple="multiple" @change="changeFiles"></s-upload-drag>
    </div>
  </a-modal>
</template>
<script setup>
import { ref } from 'vue'
import SUploadDrag from '@/components/s-upload-drag.vue'

const emit = defineEmits(['close', 'ok'])
const props = defineProps({
  title: {
    type: String,
    default: '上传Excel文件'
  },
  multiple: {
    type: Boolean,
    default: false
  }
})
const visible = ref(false)
const files = ref([])
const changeFiles = (file) => {
  console.log('当前列表', file)
}
const submit = () => {

}

const show = () => {
  visible.value = true
}
// 子组件中要通过defineExpose将方法暴露给父组件
defineExpose({ show })
</script>
<style scoped lang="scss">

</style>
